<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <link rel="stylesheet" href="docgen-resources/docgen.css" type="text/css">
  <meta name="generator" content="FreeMarker Docgen (DocBook 5)">
  <title>
    FreeMarker Manual - Old FTL syntax
  </title>
    <script type="text/javascript" src="docgen-resources/jquery.js"></script>
    <script type="text/javascript" src="docgen-resources/linktargetmarker.js"></script>
</head>
<body>

    <div class="navigation">
    <div class="breadcrumb">
<span class="breadcrumb">        You are here:
          <a href="index.html">Book</a>
            <b>></b>
          <a href="ref.html">Reference</a>
            <b>></b>
          <a href="ref_deprecated.html">Deprecated FTL constructs</a>
            <b>></b>
          Old FTL syntax
</span>    </div>
    <div class="bookmarks">
<span class="bookmarks">Bookmarks:
<a href="alphaidx.html">Alphabetical Index</a>, <a href="gloss.html">Glossary</a>, <a href="ref.html">Reference</a>, <a href="app_faq.html">FAQ</a>, <a href="api/index.html">Java API</a>, <a href="../index.html">FreeMarker Home</a></span>    </div>
    <div class="pagers">
      <div class="pagersVerticalSpacer"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></div>
<div class="pagerButton"><a href="ref_depr_numerical_interpolation.html"><span class="hideA">Next page: </span>#{...}: Numerical interpolation</a></div><div class="pagerButton"><a href="ref_depr_transform.html">Previous page</a></div><div class="pagerButton"><a href="ref_deprecated.html">Parent page</a></div><div class="pagerButton"><a href="index.html">Contents</a></div>      <div class="pagersVerticalSpacer"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></div>
    </div>
    </div>

<div id="mainContent">

  
  
  
  
  <h1 class="rank_section1"
        id="pageTopTitle">
<a name="ref_depr_oldsyntax"></a>Old FTL syntax  </h1>
    
    
<p>With the old FTL syntax the <tt style="color: #A03D10">#</tt> was not
        required (prior 2.1 not even allowed) in the FTL tags. For example,
        you could write this:</p><div align="left" class="programlisting"><table bgcolor="#D8D8D8" cellspacing="0" cellpadding="0" border="0"><tr valign="top"><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td></tr><tr><td width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td><table bgcolor="#D8D8D8" cellspacing="0" cellpadding="4" border="0" width="100%" style="margin: 0px"><tr><td><pre style="margin: 0px">
&lt;html&gt;
&lt;head&gt;
  &lt;title&gt;Welcome!&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;h1&gt;Welcome ${user}!&lt;/h1&gt;
  &lt;p&gt;We have there animals:
  &lt;ul&gt;
  <b>&lt;list animals as being&gt;</b>
    &lt;li&gt;${being.name} for ${being.price} Euros
  <b>&lt;/list&gt;</b>
  &lt;/ul&gt;
  <b>&lt;include &quot;common_footer.html&quot;&gt;</b>
&lt;/body&gt;
&lt;/html&gt;&nbsp;<span style="font-size: 1pt"> </span></pre></td></tr></table></td><td width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td></tr><tr valign="top"><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td><td height="1" width="1" bgcolor="black"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></td>      </tr>
</table>  </div>
<p>While the <tt style="color: #A03D10">#</tt>-less syntax was more natural for
        HTML authors, it had too many drawbacks, so finally we have decided to
        deprecate it. With the newer syntax (a.k.a ``strict syntax''), the
        <tt style="color: #A03D10">#</tt> is strictly required. That is, things like
        <tt style="color: #A03D10">&lt;include &quot;common_footer.html&quot;&gt;</tt> will go to the
        output as is, since they are not considered as FTL tags. Note that
        user-defined directives use <tt style="color: #A03D10">@</tt> <i>instead
        of</i> <tt style="color: #A03D10">#</tt>.</p><p>However, to give users time to prepare for this change, in
        FreeMarker 2.1 and 2.2 the usage of <tt style="color: #A03D10">#</tt> is optional,
        unless the programmer enables strict syntax mode in the FreeMarker
        configuration by calling <tt style="color: #A03D10">setStrictSyntaxMode(true)</tt>
        on <tt style="color: #A03D10">Configuration</tt>. In fact, we strongly recommend
        this to programmers. Starting from some later release this setting
        will be initially set to <tt style="color: #A03D10">true</tt>. Also, you can
        specify if you want to use strict syntax or old syntax in the template
        files with the <a href="ref_directive_ftl.html#ref.directive.ftl"><tt>ftl</tt>
        directive</a>.</p><p>The advantages of ``strict syntax'' over the legacy FTL syntax
        are:</p>    <div class="itemizedlist">
<ul>
          <li>
            <p>Since all
            <tt style="color: #A03D10">&lt;#<i style="color: #DD4400">...</i>&gt;</tt> and
            <tt style="color: #A03D10">&lt;/#<i style="color: #DD4400">...</i>&gt;</tt> are
            reserved for FTL:</p>

                <div class="itemizedlist">
<ul>
              <li>
                <p>We can introduce new directives without breaking
                backward compatibility.</p>
              </li>

              <li>
                <p>We can detect if you made a typo, i.e.
                <tt style="color: #A03D10">&lt;#inculde
                <i style="color: #DD4400">...</i>&gt;</tt> is treated as
                parse-time error, rather than silently treated as simple
                text.</p>
              </li>

              <li>
                <p>It is easier for third-party tools to handle templates
                (e.g. do syntax highlighting), especially since they don't
                have to know about the new directives introduced with new
                releases.</p>
              </li>

              <li>
                <p>Templates are more readable, since it is easier to spot
                <tt style="color: #A03D10">&lt;#...&gt;</tt> tags embedded into HTML or
                other markup.</p>
              </li>
            </ul>    </div>

          </li>

          <li>
            <p><tt style="color: #A03D10">&lt;#</tt> and <tt style="color: #A03D10">&lt;/#</tt> is
            illegal XML (except in CDATA sections), and illegal in almost all
            other SGML applications, so they can't interfere with the tags
            used in the static text parts (e.g. if you have
            <tt style="color: #A03D10">include</tt> element in the generated XML).</p>
          </li>
        </ul>    </div>
  
</div>

    <div class="navigation">
    <div class="pagers">
      <div class="pagersVerticalSpacer"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></div>
<div class="pagerButton"><a href="ref_depr_numerical_interpolation.html"><span class="hideA">Next page: </span>#{...}: Numerical interpolation</a></div><div class="pagerButton"><a href="ref_depr_transform.html">Previous page</a></div><div class="pagerButton"><a href="ref_deprecated.html">Parent page</a></div><div class="pagerButton"><a href="index.html">Contents</a></div>      <div class="pagersVerticalSpacer"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></div>
    </div>
    <div class="breadcrumb">
<span class="breadcrumb">        You are here:
          <a href="index.html">Book</a>
            <b>></b>
          <a href="ref.html">Reference</a>
            <b>></b>
          <a href="ref_deprecated.html">Deprecated FTL constructs</a>
            <b>></b>
          Old FTL syntax
</span>    </div>
    </div>

<table border=0 cellspacing=0 cellpadding=0 width="100%">
    <tr>
      <td colspan=2><img src="docgen-resources/img/none.gif" width=1 height=8 alt=""></td>
    <tr>
      <td align="left" valign="top"><span class="smallFooter">
            FreeMarker Manual -- For FreeMarker 2.3.16
            <br>
          HTML generated: 2009-12-08 08:38:54 GMT
      </span></td>
      <td align="right" valign="top"><span class="smallFooter">
          <a href="http://www.xmlmind.com/xmleditor/">
            <img src="docgen-resources/img/xxe.gif" alt="Edited with XMLMind XML Editor">
          </a>
      </span></td>
    </tr>
</table>
  <!-- Put pre-loaded images here: -->
  <div style="display: none">
    <img src="docgen-resources/img/linktargetmarker.gif" alt="Here!" />
  </div>
</body>
</html>

